home *** CD-ROM | disk | FTP | other *** search
- #include <stdlib.h>
- #include <ctype.h>
- #include "defs.h"
-
- #define PAGE0 0
-
- extern short ReWrt_flg;
- extern int MAX_SCR;
- extern unsigned int vramSeg,vramOffset;
-
- extern void wrtank(int ch,int x,int y,int fc,int bc,int of);
- extern void wrtkan(int ch,int x,int y,int fc,int bc,int of);
- extern void disp_cur(int x,int y,int of);
- extern void memcpy();
- extern void memset();
-
- UCHAR *dmy_vram=(UCHAR *)NULL;
-
- /************************
- void wrtstr(str,x,y,cl)
- unsigned char *str;
- int x,y,cl;
- {
- int fc,bc;
- register UCHAR *mp;
-
- if ( (cl & 0x10) != 0 ) {
- bc = cl & 0x0F; fc = 0;
- } else {
- fc = cl & 0x0F; bc = 0;
- }
-
- mp = dmy_vram + (x * 2 + y * (MAX_X * 2));
- while ( *str != '\0' ) {
- if ( iskanji(*str) && iskanji2(*(str+1)) ) {
- wrtkan((*str << 8) | *(str+1),x,y,fc,bc,PAGE0);
- *(mp++) = cl | 0x40;
- *(mp++) = *(str++);
- *(mp++) = cl | 0x80;
- *(mp++) = *(str++);
- x += 2;
- } else if ( *str == '\x1B' ) {
- str++;
- } else {
- wrtank(*str,x,y,fc,bc,PAGE0);
- *(mp++) = cl;
- *(mp++) = *(str++);
- x++;
- }
- if ( x >= MAX_X ) {
- y++; x = 0;
- }
- }
- }
- *********************************/
- void locate()
- {
- UCHAR *vp;
- vp = (dmy_vram + (Cur_X + OFF_X) * 2 + (Cur_Y + OFF_Y) * (MAX_X * 2));
- *vp |= 0x20;
- disp_cur(Cur_X + OFF_X,Cur_Y + OFF_Y,PAGE0);
- }
- /***************************************
- void Dsp_vram(vp)
- register UCHAR *vp;
- {
- int x,y;
- int ch,fc,bc;
- register UCHAR *mp;
-
- mp = dmy_vram + (OFF_X * 2 + OFF_Y * (MAX_X * 2));
- for ( y = 0 ; y < MAX_SCR ; y++ ) {
- for ( x = 0 ; x < MAX_X ; x++,vp+=2,mp+=2 ) {
- if ( *vp != *mp || *(vp+1) != *(mp+1) ) {
- if ( x > 0 && (*vp & 0x80) != 0 && (*(vp-2) & 0x40) != 0 ) {
- x--; vp-=2; mp-=2;
- }
- if ( (*vp & 0x10) != 0 ) {
- bc = *vp & 0x0F;
- fc = 0;
- } else {
- fc = *vp & 0x0F;
- bc = 0;
- }
- if ( (*vp & 0x40) != 0 && (*(vp+2) & 0x80) != 0 ) {
- ch = (*(vp+1) << 8) | *(vp+3);
- wrtkan(ch,x + OFF_X,y + OFF_Y ,fc,bc,PAGE0);
- memcpy(mp,vp,4);
- } else {
- wrtank(*(vp+1),x + OFF_X,y + OFF_Y ,fc,bc,PAGE0);
- memcpy(mp,vp,2);
- }
- }
- }
- }
- ReWrt_flg = ERR;
- locate();
- }
- *****************************************/
- void Dsp_vram_flash()
- {
- /*
- memset(dmy_vram,0xFF,MAX_X*MAX_Y*2);
- */
- }
- void Dsp_init()
- {
- dmy_vram = (unsigned char *)malloc(MAX_X*(MENU_Y+1)*2);
- memset(dmy_vram,0,MAX_X*(MENU_Y+1)*2);
- }
- UCHAR *Act_vram()
- {
- return (dmy_vram + (OFF_X + Cur_X) * 2 + (OFF_Y + Cur_Y) * (MAX_X * 2));
- }